package com.yidu.labyrinth.main;

import javax.persistence.*;
import java.util.Objects;

/**
 * @描述：
 * @ClassName:labyrinth
 * @backage:com.yidu.labyrinth.main
 * @Date:2019 2019/9/25 9:24
 * @Author:易嵘
 **/
@SuppressWarnings("ALL")
@Entity
public class LabyrinthModuleOrRoleEntity {

    private String moduleOrRoleId;
    private LabyrinthModuleEntity moduleId;
    private LabyrinthRoleEntity roleId;

    @Id
    @Column(name = "MODULE_OR_ROLE_ID")
    public String getModuleOrRoleId() {
        return moduleOrRoleId;
    }

    public void setModuleOrRoleId(String moduleOrRoleId) {
        this.moduleOrRoleId = moduleOrRoleId;
    }

    public LabyrinthModuleEntity getModuleId() {
        return moduleId;
    }

    public void setModuleId(LabyrinthModuleEntity moduleId) {
        this.moduleId = moduleId;
    }

    public LabyrinthRoleEntity getRoleId() {
        return roleId;
    }

    public void setRoleId(LabyrinthRoleEntity roleId) {
        this.roleId = roleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LabyrinthModuleOrRoleEntity that = (LabyrinthModuleOrRoleEntity) o;
        return Objects.equals(moduleOrRoleId, that.moduleOrRoleId) &&
                Objects.equals(moduleId, that.moduleId) &&
                Objects.equals(roleId, that.roleId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(moduleOrRoleId, moduleId, roleId);
    }
}
